/* Flowa portal base styles */

:root {
  --flowa-primary: #0e7afe;
  --flowa-bg: #f7f9fc;
  --flowa-text: #1f2937;
  --flowa-muted: #6b7280;
  --flowa-surface: #ffffff;
  --flowa-border: #e5e7eb;
}

html, body {
  background: #ffffff;
  color: var(--flowa-text);
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  margin-top: 0 !important;
  padding-top: 0 !important;
}



.flowa-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 3%;
}

.page-content-wrapper,
.page-content,
.container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
}

.page-head,
.navbar,
.navbar-brand,
#navbarSupportedContent,
.navbar-collapse,
.navbar-header,
#navbar-breadcrumbs,
#navbar-search,
.page-header,
.layout-main-section,
.page-head-content,
.page-toolbar {
  display: none !important;
}

.flowa-main.flowa-container {
  max-width: 100%;
  padding: 0;
}

/* Navbar removed per requirement */
.flowa-navbar,
.flowa-nav-inner,
.flowa-nav-left,
.flowa-nav-right {
  display: flex;
}

.flowa-navbar {
  background: #1f2733;
  color: #fff;
  height: 64px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.2);
  align-items: center;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.flowa-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.flowa-nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.flowa-navbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
}

.flowa-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.flowa-nav .nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.flowa-nav .nav-trigger {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.flowa-nav .nav-trigger::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid currentColor; /* 纯 CSS 三角形，避免字符编码问题 */
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.flowa-nav .nav-item.open .nav-trigger,
.flowa-nav .nav-trigger:hover,
.flowa-nav .nav-trigger:focus {
  color: #fff;
  background: rgba(14,122,254,0.22);
  outline: none;
}

.flowa-nav .nav-item.open .nav-trigger::after {
  transform: rotate(180deg);
}

.flowa-nav .nav-dropdown {
  position: absolute;
  top: 100%; /* 紧贴触发器，避免悬浮从触发器移到下拉时出现“空隙”导致关闭 */
  left: 0;
  min-width: 220px;
  background: #ffffff;
  color: #1f2733;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(15,23,42,0.22);
  padding: 12px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px); /* 仍保留位移动画，但不会产生 hover 空洞 */
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 2000;
}

.flowa-nav .nav-item.open .nav-dropdown,
.flowa-nav .nav-item:hover .nav-dropdown,
.flowa-nav .nav-item:focus-within .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.flowa-nav .nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 20px;
  font-size: 13px;
  color: inherit;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.flowa-nav .nav-link:hover {
  background: rgba(14,122,254,0.1);
  color: #0e7afe;
}

.flowa-nav .nav-link.pending {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.flowa-nav .nav-link.active {
  background: rgba(14,122,254,0.12);
  color: #0e7afe;
}

.flowa-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  margin-left: 8px;
  padding: 0 8px;
  background: rgba(14,122,254,0.15);
  color: #0e7afe;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.nav-columns {
  display: flex;
  gap: 24px;
  padding: 14px 20px;
}

.nav-column {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 6px;
  padding: 0 18px;
}

.flowa-nav-content[hidden] {
  display: none;
}

.flowa-nav-content {
  margin-top: 28px;
  border: 1px solid rgba(229,231,235,0.8);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15,23,42,0.08);
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 420px;
  flex: 1;
}

.flowa-nav-content-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(229,231,235,0.8);
  background: rgba(249,250,251,0.65);
}

.flowa-nav-content-header .title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.flowa-nav-content-body {
  flex: 1;
  width: 100%;
  background: #fff;
}

.flowa-nav-content-body iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
  background: #fff;
}



.flowa-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255,255,255,0.75);
  font-size: 12px;
}

.user-menu-wrapper {
  position: relative;
}

.user-chip {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.user-chip:focus {
  outline: 2px solid rgba(14,122,254,0.6);
  outline-offset: 2px;
}

.user-chip .chevron {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.user-chip.open .chevron {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  color: #1f2733;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15,23,42,0.18);
  padding: 12px 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  z-index: 2000;
}

.user-dropdown .dropdown-item,
.user-dropdown a,
.user-dropdown button {
  padding: 8px 18px;
  font-size: 13px;
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
}

.user-dropdown .dropdown-item:hover,
.user-dropdown a:hover,
.user-dropdown button:hover {
  background: rgba(14,122,254,0.08);
  color: #0e7afe;
}

.user-dropdown .dropdown-item {
  border: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
}

.user-dropdown .divider {
  height: 1px;
  background: rgba(229,231,235,0.8);
  margin: 8px 0;
}

.user-dropdown a.danger {
  color: #db3b21;
}

.user-dropdown button.danger {
  color: #db3b21;
}

.user-dropdown button.danger:hover {
  background: rgba(219,59,33,0.1);
  color: #db3b21;
}

.orders-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: #ffffff;
  border: 1px solid rgba(229,231,235,0.8);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 18px;
  align-items: flex-end;
}

.orders-filters .filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.orders-filters label {
  font-size: 12px;
  color: var(--flowa-muted);
}

.orders-filters input,
.orders-filters select {
  border: 1px solid rgba(229,231,235,0.9);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  min-height: 36px;
  background: #fff;
}

.orders-filters .filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.orders-loading {
  background: rgba(15,23,42,0.04);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  color: var(--flowa-muted);
  margin-bottom: 16px;
}

.orders-empty {
  text-align: center;
  padding: 32px 0;
  color: #9ca3af;
}

.orders-list .order-card {
  background: #ffffff;
  border: 1px solid rgba(229,231,235,0.7);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(15,23,42,0.04);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.order-card-header .order-name {
  font-weight: 600;
  font-size: 16px;
  color: #1f2937;
}

.order-card-header .order-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.order-status {
  text-align: right;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(14,122,254,0.12);
  color: #0e7afe;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  margin-bottom: 6px;
}

.status-sub {
  font-size: 12px;
  color: #6b7280;
  display: block;
}

.order-card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 14px;
}

.order-items-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.order-items-table th,
.order-items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(229,231,235,0.7);
  text-align: left;
}

.order-items-table tbody tr:last-child td {
  border-bottom: none;
}

.order-empty-row {
  text-align: center;
  color: #9ca3af;
  padding: 12px 0;
}

.orders-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
}

.orders-pagination button {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(229,231,235,0.9);
  background: #fff;
  cursor: pointer;
}

.orders-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.orders-pagination .page-info {
  font-size: 12px;
  color: #6b7280;
}
.flowa-iframe-modal[hidden] {
  display: none;
}

.flowa-iframe-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.flowa-iframe-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.35);
  z-index: 1; /* ensure backdrop sits below modal container */
}

.flowa-iframe-modal .modal-container {
  position: relative;
  width: min(80vw, 960px);
  height: min(80vh, 640px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15,23,42,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2; /* above backdrop so iframe is clickable */
}

.flowa-iframe-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(229,231,235,0.8);
}

.flowa-iframe-modal .modal-title {
  font-weight: 600;
  font-size: 15px;
  color: #1f2937;
}

.flowa-iframe-modal .modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
}

.flowa-iframe-modal .modal-close:hover {
  color: #0e7afe;
}

.flowa-iframe-modal .modal-content {
  flex: 1;
  background: #f9fafb;
}

.flowa-iframe-modal iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.flowa-nav-right select {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  min-width: 140px;
}

.flowa-nav-right select:focus {
  outline: none;
  border-color: rgba(14,122,254,0.6);
}

.flowa-nav-right .user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  padding: 4px 10px;
  border-radius: 999px;
}

.flowa-nav-right .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0e7afe;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.logo-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: url('/assets/upsystem/images/custom-e-logo.png') center/cover no-repeat, rgba(255,255,255,0.2);
}




.flowa-main-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100vh - 64px);
  margin-top: 2px; /* content sticks to navbar with 2px gap */
}

.flowa-nav-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 0;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

/* title bar removed */

.flowa-nav-content-body {
  flex: 1;
  width: 100%;
  background: #fff;
}

.flowa-nav-content-body iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
  background: #fff;
}

.flowa-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2%;
  flex: 1;
}

.flowa-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(30%, 38%) minmax(60%, 1fr);
  gap: 2%;
}

.flowa-card {
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.7);
  border-radius: 12px;
  padding: 20px;
  box-shadow: none;
}

.flowa-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.flowa-col-4 { grid-column: span 4; }
.flowa-col-6 { grid-column: span 6; }
.flowa-col-12 { grid-column: span 12; }

.flowa-muted { color: var(--flowa-muted); }
.flowa-primary { color: var(--flowa-primary); }

.flowa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--flowa-primary);
  background: var(--flowa-primary);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
}

.flowa-btn.secondary {
  background: #fff;
  color: var(--flowa-primary);
}

.flowa-section-title {
  font-size: 20px;
  font-weight: 600;
  margin: 16px 0;
}

/* Dashboard specifics */
.flowa-balance-card {
  background: linear-gradient(135deg, #e0edff 0%, #0e7afe 100%);
  color: #fff;
  padding: 22px;
  border-radius: 12px;
  border: 0;
  box-shadow: none;
}

.flowa-balance-card .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.95;
}

.flowa-balance-card .amount {
  font-size: 36px;
  font-weight: 800;
  margin: 8px 0 4px 0;
}

.flowa-inline-actions {
  display: flex;
  gap: 8px;
}

.flowa-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
}

.flowa-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.flowa-stat {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flowa-stat .icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4f46e5;
  font-weight: 700;
}

.flowa-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.flowa-kpi {
  padding: 14px 16px;
  border-left: 1px solid var(--flowa-border);
}

.flowa-kpi:first-child { border-left: 0; }

.flowa-kpi .num { font-weight: 700; }
.flowa-kpi .label { color: var(--flowa-muted); font-size: 12px; }

.flowa-announcement {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flowa-announcement .item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px dashed var(--flowa-border);
  color: var(--flowa-muted);
}

.flowa-orders-grid {
  grid-template-columns: minmax(65%, 72%) minmax(24%, 30%);
}

.flowa-orders-grid .flowa-card {
  height: 100%;
}

.flowa-orders-grid .flowa-announcement {
  min-height: auto;
}

/* Orders page */
.flowa-orders {
  background: #f7f9fc;
  padding: 24px 0 40px 0;
}

.flowa-orders-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: flex-start;
}

.flowa-orders-sidebar {
  background: var(--flowa-surface);
  border: 1px solid var(--flowa-border);
  border-radius: 12px;
  padding: 20px 0;
  box-shadow: 0 1px 4px rgba(15,23,42,0.08);
}

.flowa-orders-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.flowa-orders-sidebar li {
  padding: 10px 24px;
  font-size: 14px;
  color: var(--flowa-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.flowa-orders-sidebar li.active {
  background: rgba(14,122,254,0.12);
  color: var(--flowa-primary);
  font-weight: 600;
}

.flowa-orders-content {
  background: var(--flowa-surface);
  border: 1px solid var(--flowa-border);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 6px rgba(15,23,42,0.08);
}

.flowa-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.flowa-toolbar select,
.flowa-toolbar input,
.flowa-toolbar button,
.flowa-toolbar .chip {
  background: #fff;
  border: 1px solid var(--flowa-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.flowa-toolbar button.primary {
  background: var(--flowa-primary);
  color: #fff;
  border-color: var(--flowa-primary);
}

.flowa-tagline {
  margin: 16px 0;
  padding: 12px;
  border-radius: 8px;
  background: rgba(14,122,254,0.08);
  color: var(--flowa-primary);
  font-size: 12px;
}

.flowa-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.flowa-table th, .flowa-table td {
  border-bottom: 1px solid var(--flowa-border);
  padding: 12px 14px;
  font-size: 12px;
}

.flowa-table th {
  text-align: left;
  color: var(--flowa-muted);
  font-weight: 600;
}

.flowa-empty {
  padding: 48px 0;
  text-align: center;
  color: #f97373;
  font-weight: 600;
}

